package com.ganyu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ganyu.domain.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户和角色关联表(UserRole)表数据库访问层
 *
 * @author chenxi
 * @since 2022-09-28 10:12:00
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {
    Long getRoleId(@Param("id") Long id);

    //根据user_id删除role_id
    void deleteRoleByUserId(@Param("aLong") Long aLong);

    //向数据库中插入user_id和role_id
    void insertRole(@Param("aLong")Long aLong, @Param("roleId")Long roleId);

    List<Long> getRoleIdList(@Param("id")Long id);

}

